<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
         
        <div id="title">goupiao</div>
    </div>

    <script>
        let app = document.getElementById('app')
        let title = document.getElementById('title')
        

        window.addEventListener('click',() =>{
            console.log('window');

        },true)
        app.addEventListener('click',(e) => {
            console.log('app');
            e.stopPropagation()
        },true)

        title.addEventListener('click',(e) => {
            console.log('title');
            // 阻止冒泡
            // e.stopPropagation()
            // e.stopImmediatePropagation()
        },false)
        
    </script>
</body>
</html>